package name.huzhenbo.java.patterns.factory;

class SpecialAutoFactory implements AutoFactory {
    public Auto make(String type) throws Exception {
        if ("car".equals(type)) {
            return new SpecialCar();
        } else if ("motocycle".equals(type)) {
            return new SpecialMotocycle();
        } else {
            throw new Exception("Cannot make auto of type: " + type);
        }
    }
}
